VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "TestRunner"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Private mReporter As TestReport

Public Sub RunAllTestsFrom(coll As Collection, wkbk As Workbook, repSheetname As String)

Dim testObj As TestCase
Dim builder As xlUnitCodeBuilder

    Set mReporter.reportSheet = wkbk.Worksheets(repSheetname)

    For Each testObj In coll
        mReporter.RecordNewTestObject testObj.Title
        testObj.Setup
        testObj.Run mReporter
        testObj.Teardown
    Next
       
    mReporter.Summarise
    
    Set builder = New xlUnitCodeBuilder
    
    builder.RemoveModule harness.book, TESTRUNNER_MODULE_NAME
       
    harness.AttemptHookup
    
End Sub

Private Sub Class_Initialize()
    Set mReporter = New TestReport
End Sub

Private Sub Class_Terminate()
    Set mReporter = Nothing
End Sub
